package com.heima.article.controller.v1;

import com.heima.article.service.IApArticleService;
import com.heima.model.acticle.dtos.ArticleDto;
import com.heima.model.common.dtos.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Api("内部调用")
public class ApArticleFeignController {

    @Resource
    private IApArticleService iApArticleService;

    @ApiOperation("后端文章保存调用app端")
    @PostMapping("/after/one")
    public ResponseResult afterSave(@RequestBody ArticleDto dto){

        /*try {
            Thread.sleep(3000);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }*/
        return iApArticleService.afterSave(dto);
    }
}
